/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Admin
 */
@Embeddable
public class MediaLikePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "media_id", nullable = false)
    private int mediaId;
    @Basic(optional = false)
    @Column(name = "user_id", nullable = false)
    private int userId;

    public MediaLikePK() {
    }

    public MediaLikePK(int mediaId, int userId) {
        this.mediaId = mediaId;
        this.userId = userId;
    }

    public int getMediaId() {
        return mediaId;
    }

    public void setMediaId(int mediaId) {
        this.mediaId = mediaId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) mediaId;
        hash += (int) userId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MediaLikePK)) {
            return false;
        }
        MediaLikePK other = (MediaLikePK) object;
        if (this.mediaId != other.mediaId) {
            return false;
        }
        if (this.userId != other.userId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.MediaLikePK[mediaId=" + mediaId + ", userId=" + userId + "]";
    }

}
